package com.wlxy.springbootdemo.controller;

import com.sun.org.glassfish.external.statistics.annotations.Reset;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * 在线表格操作
 *
 * @author thinkpad
 */
@RestController
public class SheetController {

    /**
     * 初始化表格数据
     *
     * @return
     */
    @PostMapping("/loadUrl")
    public String loadUrl() {
        return "[{\"name\":\"Data\",\"index\":\"1\",\"order\":1,\"status\":1}]";
    }

    /***
     * 实时更新数据库
     * @param jsonExcel
     * @return
     * @throws IOException
     */
    @PostMapping("/updateUrl")
    public Object updateUrl(String jsonExcel) throws IOException {
        System.out.println(jsonExcel);
        return true;
    }
}
